package com.googlecode.grs.sensor;

/**
 * A servo is an intermediate sensor mount that can precisely change position.
 * In simulation a servo simply abstracts control of sensor mounted angle
 * 
 * @author ajc
 * 
 */
public class Servo {

	private double angle;

	/**
	 * 
	 * @param initialAngle
	 */
	public Servo(double initialAngle) {
		this.angle = initialAngle;
	}

	/**
	 * 
	 * @return the angle difference between the servo and robot, in radians
	 */
	public double getAngle() {
		return angle;
	}

	/**
	 * Rotates the servo such that 0 offset sensors (relative to this servo)
	 * will have a robot offset of the provided angle
	 * 
	 * @param angle
	 *            difference from robot heading (negative ccw, positive cw) in
	 *            radians
	 */
	public void rotateTo(double angle) {
		this.angle = angle;
	}

}
